package com.thesis.manage.feign.fallback;

import com.thesis.manage.common.exception.CommonException;
import com.thesis.manage.common.utils.Result;
import com.thesis.manage.feign.UserService;
import com.thesis.manage.service.constant.ErrorMessage;
import com.thesis.manage.service.model.StateCodeEnum;

/**
 * @author php
 * @date 2018/1/24
 */
public class UserServiceImpl implements UserService {
    @Override
    public Result register(String account, String password, Integer type) {
        return Result.build(StateCodeEnum.NETWORKERROR.getValue(), ErrorMessage.NETWORK_ERROR);
    }

    @Override
    public Result login(String account, String password, Integer type) {
        return Result.build(StateCodeEnum.NETWORKERROR.getValue(), ErrorMessage.NETWORK_ERROR);
    }

    @Override
    public Result findUserByToken(String token) {
        return Result.build(StateCodeEnum.NETWORKERROR.getValue(), ErrorMessage.NETWORK_ERROR);
    }

    @Override
    public Result checkToken(String token) {
        return Result.build(StateCodeEnum.NETWORKERROR.getValue(), ErrorMessage.NETWORK_ERROR);
    }

    @Override
    public void expire(String token, Integer type) {
        throw new CommonException("Internal error of the system", ErrorMessage.NETWORK_ERROR);
    }

    @Override
    public Result logout(String token) {
        return Result.build(StateCodeEnum.NETWORKERROR.getValue(), ErrorMessage.NETWORK_ERROR);
    }
}
